<template>
  <div>
    <h1>使用</h1>
    <el-button @click="changeValue">修改VALUE</el-button>
    {{ value }}
    <el-button @click="getCode">获取svg</el-button>
    <div class="login-code" v-html="codeUrl"/>

    <router-link to="/404">跳转</router-link>

  </div>
</template>

<script>
import {mapState} from 'vuex'

export default {
  name: "index",
  data() {
    return {}
  },
  computed: {
    ...mapState({
      value: state => state.test.value,
      codeUrl: state => state.test.codeUrl
    })
  },
  mounted() {
  },
  methods: {
    changeValue() {
      this.$store.commit('test/SET_VALUE', Math.random().toFixed(2))
    },
    getCode() {
      this.$store.dispatch('test/getCode')
    },
  }

}
</script>

<style scoped>

</style>
